<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<style type="text/css">
		.div1{
			width: 100px;
			height: 100px;
			background: palevioletred;
			position: relative;
			left: 0;
			top: 100px;
		}
		.div2{
			width: 100px;
			height: 100px;
			background: skyblue;
			position: relative;
			left: 0px;
			top: -50px;
		}
	/*	此时,两个div都有relative属性,后写的div被先写的div覆盖,两个div形成层级*/
	</style>
	<body>
		<div class="div1">
			
		</div>
		<div class="div2">
			
		</div>
	</body>
</html>
